// 基于12个不同数据的分组优化
let vegs = [
    {
        id: 1,
        name: "小龙虾",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 15,
        info: "小龙虾很好吃",
        type: "海鲜",
        selected: false
    },
    {
        id: 2,
        name: "大龙虾",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 15,
        info: "大龙虾肉质紧实",
        type: "海鲜",
        selected: false
    },
    {
        id: 3,
        name: "麻辣小龙虾",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 18,
        info: "麻辣鲜香的经典口味",
        type: "海鲜",
        selected: false
    },
    {
        id: 4,
        name: "米饭",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 2,
        info: "粒粒分明的白米饭",
        type: "主食",
        selected: false
    },
    {
        id: 5,
        name: "馒头",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 1,
        info: "松软可口的白面馒头",
        type: "主食",
        selected: false
    }, 
    {
        id: 6,
        name: "西葫芦炒鸡蛋",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 12,
        info: "清爽可口的家常小炒",
        type: "炒菜",
        selected: false
    }, 
    {
        id: 7,
        name: "麻辣猪蹄",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 25,
        info: "软糯脱骨，麻辣过瘾",
        type: "炒菜",
        selected: false
    },
    {
        id: 8,
        name: "清炒时蔬",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 10,
        info: "新鲜蔬菜清炒保留原味",
        type: "炒菜",
        selected: false
    },
    {
        id: 9,
        name: "红烧肉",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 30,
        info: "肥而不腻的经典名菜",
        type: "炒菜",
        selected: false
    },
    {
        id: 10,
        name: "清蒸鱼",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 45,
        info: "鲜嫩多汁的清蒸鱼",
        type: "海鲜",
        selected: false
    },
    {
        id: 11,
        name: "饺子",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 18,
        info: "手工包制的美味饺子",
        type: "主食",
        selected: false
    },
    {
        id: 12,
        name: "宫保鸡丁",
        photo: "https://images.pexels.com/photos/4353638/pexels-photo-4353638.jpeg?auto=compress&cs=tinysrgb&w=1600",
        price: 28,
        info: "香辣可口的传统川菜",
        type: "炒菜",
        selected: false
    }
];
 
export function getVegs() {
    return vegs;
}

const vegstypes = vegs.map((veg) =>veg.type)
const set = [...new Set(vegs.map((veg) =>veg.type))] ;
const vegtypes = Array.from(set);
console.log(set);

